package com.casstime.ec.cloud.service;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.casstime.ec.cloud.spi.PagedModels;
import com.casstime.ec.cloud.values.business.SupplierPromotionConfig;
import com.casstime.ec.cloud.values.business.SupplierPromotionConfigRecord;

/**
 * 
 * ClassName: SupplierPromotionConfigService 
 * Function: (店铺促销规则)
 * Reason: ADD REASON(可选).
 *  
 * @author hongcheng.wu  
 * 2018年4月17日 上午9:59:04
 * @version   
 * @since JDK 1.8
 */
@FeignClient("discount-service")
public interface SupplierPromotionConfigService {

	/**
	 * 
	 * insertSupplierPromotionConfig:(插入或者更新店铺促销配置信息).<br/>  
	 * @param supplierPromotionConfig
	 * @return
	 * @throws Exception
	 * @author hongcheng.wu
	 * @date 2018年4月17日 上午10:12:20
	 */
	@RequestMapping(value = "/discount/promotionConfig/insertSupplierPromotionConfig", method = RequestMethod.POST)
	int insertSupplierPromotionConfig(@RequestBody SupplierPromotionConfig supplierPromotionConfig,
			@RequestParam("userLoginId") String userLoginId) throws Exception;
	
	/**
	 * 
	 * getSupplierPromotionConfig:(单个获取店铺促销配置信息).<br/>  
	 * @param productStoreId
	 * @return
	 * @throws Exception
	 * @author hongcheng.wu
	 * @date 2018年4月17日 上午10:12:50
	 */
	@RequestMapping(value = "/discount/promotionConfig/findByProductStoreId", method = RequestMethod.GET)
	SupplierPromotionConfig getSupplierPromotionConfig(@RequestParam("productStoreId") String productStoreId,
			@RequestParam(value = "configType", required = false) String configType) throws Exception;
	
	/**
	 * 
	 * getSupplierPromotionConfigList:(批量获取店铺促销规则配置信息).<br/>  
	 * @return
	 * @throws Exception
	 * @author hongcheng.wu
	 * @date 2018年4月17日 下午5:22:16
	 */
	@RequestMapping(value = "/discount/promotionConfigList/findByProductStoreIds", method = RequestMethod.POST)
	List<SupplierPromotionConfig> getSupplierPromotionConfigList(@RequestBody List<String> productStoreIds,
			@RequestParam(value = "configType", required = false) String configType) throws Exception;
	
	/**
	 * 
	 * listSupplierPromotionConfigRecordById:(查询店铺促销配置记录).<br/>  
	 * @param productStoreId
	 * @param pageSize
	 * @param pageNum
	 * @return
	 * @throws Exception
	 * @author hongcheng.wu
	 * @date 2018年4月17日 上午10:13:12
	 */
	@RequestMapping(value = "/discount/promotionConfig/updateRecord/{productStoreId}", method = RequestMethod.GET)
	PagedModels<SupplierPromotionConfigRecord> listSupplierPromotionConfigRecordById(@PathVariable("productStoreId") String productStoreId,
														   @RequestParam("pageSize") Integer pageSize,
														   @RequestParam("pageNum") Integer pageNum) throws Exception;
	
	
}
